<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:fragment="loading">
    <script>
        $(function(){
            $.ajaxSetup({
                beforeSend:function(){
                    $("#loading").show()
                },
                complete:beforeSend:function(){
                   $("#loading").hide()
                }
            })
        })
    </script>
<!-- loading -->
    <div class="modal fade" id="loading" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop='static'>
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel">提示</h4>
                </div>
                <div class="modal-body">
                    请稍候。。。<span id="result"></span>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>